import QtQuick
import QtQuick.Particles

import "../as_qml"

Window {
    id: root
    width: 520
    height: 360
    visible: true
    title: qsTr("使用说明")

    property color mTextColor: "#1a1c1e"

    Rectangle {
        anchors.fill: parent
        color: "#d2d4d6"

        Column {
            anchors.centerIn: parent
            spacing: 5

            Repeater {
                model: ["1. 首页打开摄像头使用抓拍功能,在亮度足够的环境下尽可能多的拍下",
                        "    各个角度的人脸.",
                        "2. 将抓拍的人脸图片进行预处理(工具->预处理图片),逐一检测并移除",
                        "    不包含人脸的图片,最后使用一键处理功能.",
                        "3. 选择根目录文件夹以生成CSV文件(工具->生成CSV文件),该文件便",
                        "    于后续生成识别器模型,请参照图文展示打开正确的根目录文件夹,",
                        "    是保存着预处理过的图片的文件夹哦.",
                        "4. 根据CSV文件生成识别器模型(工具->生成识别器模型),有三种模型",
                        "    分类可选,具体含义自行查阅资料.",
                        "5. 首页选择刚刚生成的识别器模型文件,并选择与之匹配的模型分类,",
                        "    然后打开摄像头,此时的识别是加载了识别器的,人脸框左上角会显",
                        "    示预测结果."]

                delegate: AsText {
                    width: 400
                    text: modelData
                    color: mTextColor
                    font.pixelSize: 13
                }
            }
        }
    }

    MouseArea {
        anchors.fill: parent

        onPressed: {
            emitter.x = mouseX
            emitter.y = mouseY - emitter.height
            emitter.enabled = true
        }

        onReleased: {
            emitter.enabled = false
        }

        onPositionChanged: function(mouse) {
            emitter.x = mouse.x
            emitter.y = mouse.y - emitter.height
        }
    }

    ParticleSystem {
        id: particleSystem
    }

    ImageParticle {
        id: lovePainter
        source: "qrc:/img/love.png"
        system: particleSystem
    }

    Emitter {
        id: emitter
        x: 0
        y: 0
        width: 10
        height: 10
        system: particleSystem
        enabled: false
        emitRate: 20

        lifeSpan: 1000
        lifeSpanVariation: 400

        size: 14
        endSize: 24
        sizeVariation: 5
    }

}
